package com.zqwm.fly.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.util.UUID;

@SuppressWarnings("all")
public class MD5Util
{
	
	public static String getMD5str(String s)
	{
		String result=s;
		try {
			MessageDigest md = MessageDigest.getInstance("MD5");
			md.update(result.getBytes());
			result=new BigInteger(1, md.digest()).toString(16);
		} catch (Exception e) {
		}
		
		return result;
	}

	public static String getSHA1str(String s) {
		String result=s;
		try {
			MessageDigest md = MessageDigest.getInstance("SHA1");
			md.update(result.getBytes());
			result=new BigInteger(1, md.digest()).toString(16);
		} catch (Exception e) {
		}

		return result;
	}

	public static String GetUUID() {
		 return UUID.randomUUID().toString();
	}
}
